<template>
  <!-- 第三步：使用组件 -->
  <!--  -->
  <ul class="todo-main">
    <MyItem v-for="todoObj in todos"
            :key="todoObj.id"
            v-bind:todo="todoObj"
            v-bind:checkTodo="checkTodo"
            v-bind:deleteTodoObj="deleteTodoObj"
    >
    </MyItem>
  </ul>
</template>

<script>
// 第一步：引入组件，其中在脚手架里面，后缀.vue写不写都可以
import MyItem from "@/components/MyItem.vue";

export default {
  name: 'MyList',
  // 第二步：注册组件
  components: {
    MyItem: MyItem,
  },
  props: ['todos', 'checkTodo', 'deleteTodoObj'],
}
</script>

<style scoped>

/*main*/
.todo-main {
  margin-left: 0px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 0px;
}

.todo-empty {
  height: 40px;
  line-height: 40px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding-left: 5px;
  margin-top: 10px;
}

</style>